<?php
session_start();
require_once("../lib/standard.php");
require_once("../fantasmatakia/pektis.php");

$globals->set_pektis();
$login = Globals::parametros("login");
if ($globals->not_pektis() || ($globals->pektis->login != $login)) {
	die("Πιθανή εισβολή");
}
	
$onoma = Globals::parametros("onoma");
$email = Globals::parametros("email");
$kodikos = Globals::parametros("kodikos");
$trexon = sha1(Globals::parametros("trexon"));

$query = "UPDATE `pektis` SET `onoma` = '" . 
	$globals->asfales($onoma) . "', `email` = '" .
	$globals->asfales($email) . "'";
if ($kodikos != '') {
	$query .= ", `kodikos` = '" .sha1($kodikos) . "'";
}
$query .= " WHERE `login` = '" . $globals->asfales($login) .
	"' AND `kodikos` = '" . $globals->asfales($trexon) . "'";
$globals->query($query);
if (mysqli_affected_rows($globals->db) == 1) {
	die("@ok@");
}

print "Απέτυχε η ενημέρωση";

?>

